<?php
/**
 * 
 * 系统
 * @author Administrator
 *
 */
class sysActions extends BaseAdminActions
{
	public $sys;
	public function __construct()
	{		
		parent::__construct();
		Files::factory('AdminSys');
		$this->sys = new AdminSys();
	}
	
	public function actionsIndex()
	{
		$this->actionsMsglist();
		die();
	}
	/**
	 * 
	 * 添加公告页
	 */
	public function actionsMsgsend()
	{
		if (Http::get('do')=='send'){
			$stype = Http::post('stype');
			$content = Http::post('content');			
			$socketData = 'sys_login {"name":"b","pwd":"123456"}';
			//$socketData =  pack ( 'I', strlen ( $socketData ) ) . $socketData;
			$result = socketData('192.168.1.129',4444,$socketData);
			
			$this->sys->insertSendList($stype,$content,$result);
			die($result);
		}
		
	}
	
	/**
	 * 
	 * 列表页面
	 */
	public function actionsMsglist()
	{
		if (Http::get('do')=='del'){
			$id = Http::get('id');
			if ($this->sys->deleteMsg($id)){
				die('成功');
			}else {
				die('失败');
			}
		}
		$rs = $this->sys->getSendList();
		$this->assign('rs', $rs);
		$this->display('msglist.tpl.php');
	}
}